package Java.BlackHorse.a04FileTest;

import java.io.File;

public class Test2 {
    public static void main(String[] args) {
        File file = new File("a04FileTest","aaa");
        boolean exist = containTxtfile(file);
        System.out.println(exist);
    }

    public static boolean containTxtfile(File dir){
        File[] files = dir.listFiles();
        for(File f : files){
            if(f.isFile() && f.getName().endsWith(".txt")){
                return true;
            }
        }
        return false;
    }

}
